/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nurdrobotics;

import edu.wpi.first.wpilibj.*;
// air compresor
/**
 *
 * @author hpadmin
 */
public class PneumaticClaw {
    private Solenoid openSolenoid;
    private Solenoid closeSolenoid;
    private boolean isOpen = false;

    public PneumaticClaw (int openChannel, int closeChannel) {
        openSolenoid = new Solenoid(openChannel);
        closeSolenoid = new Solenoid(closeChannel);
        this.Open();
    }

    public void Open () {
        openSolenoid.set(true);
        closeSolenoid.set(false);
        isOpen = true;

        System.out.println("opening:   open=" + openSolenoid.get() + " closed=" + closeSolenoid.get());
    }

    public void Close () {
        openSolenoid.set(false);
        closeSolenoid.set(true);
        isOpen = false;

        System.out.println("closing:   open=" + openSolenoid.get() + " closed=" + closeSolenoid.get());
    }

    public boolean IsOpen() {
        return isOpen;
    }

    public boolean IsClosed() {
        return !IsOpen();
    }

}
